
import Vue from "vue";

//页面状态相关
let status = {
};

// 和网络交互相关的参数
let params = {
  searchParams:{
    date : "",
    orderKey : "",
    orderType : ""
  }
};

// 页面的数据源
let data = {
  productDailyList: [],
};

// 页码相关
let page = {
  total: 1,
  startIndex: 0,
  stepNumber: 60,
  currentPage: 1
};

//列表
let productDailyTable=function (self) {
  return [
    {
      type: 'index',
      title: '#',
      width: 70,
      key: 'index',
      fixed: 'left',
      align: 'center',
    },
    {
      title: '产品编码',
      width: 180,
      key: 'productCode',
      align:'center',
      render: (h, params) => {
        let productUrl = Vue.prototype.$tiyProductUrl(params.row.productCode);
        return h('div', [h('a', {
          attrs: {href: productUrl, target: '_blank'}
        }, params.row.productCode)]);
      }
    },
    {
      title: '一级分类',
      width: 200,
      key: 'classification1Name',
      align:'center'
    },
    {
      title: '二级分类',
      width: 200,
      key: 'classification2Name',
      align:'center'
    },
    {
      title: '加购次数',
      width: 120,
      key: 'addCartTimes',
      align:'center',
      sortable: 'custom'
    },
    {
      title: '加购数量',
      width: 120,
      key: 'addCartNumber',
      align:'center',
      sortable: 'custom'
    },
    {
      title: '订单数',
      width: 110,
      key: 'orderCount',
      align:'center'
    },
    {
      title: '下单次数',
      width: 120,
      key: 'orderTimes',
      align:'center',
      sortable: 'custom'
    },
    {
      title: '下单数量',
      width: 120,
      key: 'orderNumber',
      align:'center',
      sortable: 'custom'
    },
    {
      title: '销售额',
      width: 120,
      key: 'saleAmount',
      align:'center'
    }
  ];
};

export  default  {
  tStatus: status,
  tParams: params,
  tData: data,
  tPage: page,
  productDailyTable:productDailyTable,
};
